function onVid0StateChange(newState) {
	videoStatus(newState, 0);	
}

function onVid1StateChange(newState) {
	videoStatus(newState, 1);	
}

// state of video changed
function videoStatus(newState, slot) {
	// states:
	// -1: Unstarted
	// 	0: Ended
	//	1: Playing
	// 	2: Paused
	// 	3: Buffering
	// 	5: Cued
	
	vidState[slot] = newState;
	
	// playing
	if (newState==1) {
				
		// cue
		if (vidCueing[slot] == true) {
			// cue video
			videoGotoPerc(0, slot);
			setSliderSlider(0, slot);
			videoPause(slot);			
			vid[slot].unMute();
			vidCueing[slot] = false;
			printLog('Video cued in slot ' + slot);
		}
		
	} 
}